<?php


class SvcTarifs extends SvcCommun {
    
    
    protected static $title='Tarifs';
    protected static $bodyCssClass='tarif';
    
    
    public static function construireTarifs($page){
        $profiles=ClientProfile::loadAll();
        $ages=ClientAge::loadAll();
        $periodes=Periode::loadAll();
        $tempTarifs=Tarif::loadAll();
        
        $tarifs=array();
        foreach($tempTarifs as $tempTarif){
            if(!isset($tarifs[$tempTarif->CLPR_NUMID]))
                      $tarifs[$tempTarif->CLPR_NUMID]=array();
            if(!isset($tarifs[$tempTarif->CLPR_NUMID][$tempTarif->CLAG_NUMID]))
                      $tarifs[$tempTarif->CLPR_NUMID][$tempTarif->CLAG_NUMID]=array();
            $tarifs[$tempTarif->CLPR_NUMID][$tempTarif->CLAG_NUMID][$tempTarif->PERI_NUMID]=$tempTarif->TARF_PXTTC;
        }
        
        include($page);
    }
    
    
    
    public static function construire(){
        self::construireTarifs('php/page/tarifs.php');
    }
    
    
}


?>